package br.com.tweetsentiment.conexao;

import twitter4j.Twitter;
import twitter4j.TwitterFactory;
import twitter4j.conf.ConfigurationBuilder;


public class ConexaoTwitter {
	 	
	private static ConexaoTwitter rConexao;
	
	protected ConexaoTwitter()
	{
	
	}
	
	public static ConexaoTwitter getInstance()
	{
		if(rConexao == null)
		{
			return rConexao = new ConexaoTwitter();
		}
		
		return rConexao;
	}
	
	public Twitter getInstanceTwitter()
	{
		ConfigurationBuilder cb = new ConfigurationBuilder();
		
		cb.setDebugEnabled(true);
		cb.setOAuthConsumerKey("WCaatDBlFQLMYw3iKIYIQ");
		cb.setOAuthConsumerSecret("fC2fqUXVnZoOIixrQGwi9E5u7mgEsswxbi7HgxVc8");
		cb.setOAuthAccessToken("42137488-nGSJ3KWzw6DHI8ofd0FMtL5BweEcFtv6K0aTdosIY");
		cb.setOAuthAccessTokenSecret("8o1IMbeodqhuq1z0xoaIxC8ZPTE4ouEiyd9b7QKjrY");
		
		TwitterFactory tf = new TwitterFactory(cb.build());
		
		return  tf.getInstance();
	}
}
